<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<script language="JavaScript">
function search_submit()
{
if($('#asktitle').val() =="")
    {
$('#asktitle').focus();
alert("请填写您要搜索的问题.");
return false;
}
var keywords=$('#asktitle').val();
redirect("<?php echo $M['url'];?>search.php?keywords="+keywords);
}
</script>
<!--begin main-->
<div id="main">
  <!--begin left-->
  <div id="main_l">
    <div id="mian_l_1">
      <!--begin 问吧导航-->
      <div id="ask_nav_top">
        <h3>问吧导航</h3>
      </div>
      <div id="ask_nav">
<?php if(is_array($C)) foreach($C AS $cat) { ?>
<?php if(!$cat[parentid]) { ?><?php $cols=1;?>
<dl>
<dt><a href="<?php echo $cat['url'];?>" ><?php echo $cat['catname'];?></a></dt>
<dd><?php if(is_array($C)) foreach($C AS $childcat) { ?>
<?php if($cols<4 && $childcat[parentid]==$cat[catid]) { ?><a href="<?php echo $childcat['url'];?>" ><?php echo $childcat['catname'];?></a>
<?php $cols++;?>
<?php } ?>
<?php } ?><a href="<?php echo $cat['url'];?>" >>></a>
</dd></dl>
<?php } ?>
<?php } ?>
      </div>
      <div id="ask_nav_btm"></div>
      <!--end 问吧导航-->
      <!--问吧广告位-->
    </div>
    <div id="mian_l_2">
      <!--begin 发布问题-->
      <div id="box_1">
<form name="wordform" action="<?php echo $M['url'];?>question.php" method="post">
<input name="title" id="asktitle" type="text" style="width:260px;" />
<input type="submit" value="我要提问" style="width:60px;" /> 
<input type="button" value="搜索答案" name="search" onClick="search_submit();" style="width:60px;" />
</form>
        <div id="search_div">
        <ul id="tl">
        </ul>
        
      </div>
      </div>
      
      <!--end 发布问题-->
      <div class="cat">
        <h3><a href="<?php echo $M['url'];?>browse.php?action=nosolve"><img src="images/more.gif" alt="更多"/></a>待解决问题<span>(<?php echo $nosolve_ques_count;?>)</span></h3>
        <ul><?php echo tag('ask', 'tag_ask', "SELECT * FROM `zzinfo_ask` WHERE status='3'  ORDER BY askid DESC", 0, 10, array (  'catid' => '0',  'userid' => '',  'flag' => '-1',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '1',  'titlelen' => '45',));?></ul>
      </div>
      <!--广告位-->
      <div class="ad mar_10"><script language="javascript" src="data/js.php?id=4"></script></div>
      <div class="cat">
        <h3><a href="<?php echo $M['url'];?>browse.php?action=solve"><img src="images/more.gif" alt="更多"/></a>已解决问题<span>(<?php echo $solve_ques_count;?>)</span></h3>
        <ul><?php echo tag('ask', 'tag_ask', "SELECT * FROM `zzinfo_ask` WHERE status='5'  ORDER BY askid DESC", 0, 10, array (  'catid' => '0',  'userid' => '',  'flag' => '-1',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '1',  'titlelen' => '45',));?></ul>
      </div>
    </div>
  </div>
  <!--end left-->
  <!--begin right-->
  <div id="main_r">
    <h4>热点问题</h4>
    <div>
      <ul class="text_list"><?php echo tag('ask', 'tag_ask', "SELECT * FROM `zzinfo_ask` WHERE status='3'  ORDER BY hits DESC", 0, 4, array (  'catid' => '0',  'userid' => '',  'flag' => '-1',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '0',  'titlelen' => '46',));?></ul>
    </div>
    <h4>推荐问题</h4>
    <div class="text_list">
      <ul><?php echo tag('ask', 'tag_ask', "SELECT * FROM `zzinfo_ask` WHERE status>2  AND flag='3' ORDER BY askid DESC", 0, 10, array (  'catid' => '0',  'userid' => '',  'flag' => '3',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '0',  'titlelen' => '46',));?></ul>
    </div>
     <h4 class="tag_box">积分排行<span class="tag_menu_1"><a href="<?php echo $M['url'];?>creditlist.php?action=week" onMouseOver="showContent('0')" id="nav0">上周</a><a href="<?php echo $M['url'];?>creditlist.php?action=month" onMouseOver="showContent('1')" id="nav1">上月</a><a href="<?php echo $M['url'];?>creditlist.php?action=all" onMouseOver="showContent('2')" id="nav2" class="selected">总排行</a></span></h4>
    <div id="content0" style="display:none;">
      <ul class="text_list_1">
  <?php echo tag('ask', 'tag_credit', "SELECT m.userid,m.username,m.preweek AS point,i.lastlogintime,i.logintimes,i.actortype,i.answercount,i.acceptcount FROM `zzinfo_ask_credit` m LEFT JOIN `zzinfo_member_info` i ON m.userid=i.userid ORDER BY preweek DESC", 0, 10, array (  0 => '',  'class' => 'url',  'target' => '_blank',));?>
      </ul>
    </div>
<div id="content1" style="display:none;">
      <ul class="text_list_1">
  <?php echo tag('ask', 'tag_credit', "SELECT m.userid,m.username,m.premonth AS point,i.lastlogintime,i.logintimes,i.actortype,i.answercount,i.acceptcount FROM `zzinfo_ask_credit` m LEFT JOIN `zzinfo_member_info` i ON m.userid=i.userid ORDER BY premonth DESC", 0, 10, array (  0 => '',  'class' => 'url',  'target' => '_blank',));?>
      </ul>
    </div>
<div id="content2">
      <ul class="text_list_1">
  <?php echo tag('ask', 'tag_credit', "SELECT m.userid,m.username,m.point,i.lastlogintime,i.logintimes,i.actortype,i.answercount,i.acceptcount FROM `zzinfo_member` m LEFT JOIN `zzinfo_member_info` i ON m.userid=i.userid ORDER BY point DESC", 0, 10, array (  0 => '',  'class' => 'url',  'target' => '_blank',));?>
      </ul>
    </div>
  </div>
  <!--end right-->
</div>
<script language="JavaScript">
<!--
function showContent(id)
{
for (var i = 0;i < 3;i++)
{
var nav = document.getElementById("nav" + i);
var content = document.getElementById("content" + i);
if (i == id)
{
nav.className = 'selected';
content.style.display = "";
}
else
{
nav.className = '';        
content.style.display = "none";
}
}
}
var modurl = '<?php echo $MODULE['ask']['url'];?>';
 //-->
</script>
<script type="text/javascript" src="<?php echo PHPCMS_PATH;?>images/js/ask_search_json.js"></script>
<!--end main-->
<!--begin foot-->
<?php include template('phpcms','footer'); ?>